//package com.yxuan.springboot.constant.config;
//
//import com.github.xiaoymin.swaggerbootstrapui.annotations.EnableSwaggerBootstrapUI;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import springfox.documentation.builders.ApiInfoBuilder;
//import springfox.documentation.builders.ParameterBuilder;
//import springfox.documentation.builders.RequestHandlerSelectors;
//import springfox.documentation.schema.ModelRef;
//import springfox.documentation.service.ApiInfo;
//
//import springfox.documentation.service.Parameter;
//
//import springfox.documentation.service.Contact;
//
//import springfox.documentation.spi.DocumentationType;
//import springfox.documentation.spring.web.plugins.Docket;
//import springfox.documentation.swagger2.annotations.EnableSwagger2;
//import java.util.ArrayList;
//import java.util.List;
//
//@Configuration
//@EnableSwagger2
//@EnableSwaggerBootstrapUI    //添加注解
//public class SwaggerConfig{
//    @Bean
//    public Docket customDocket() {
//        return new Docket(DocumentationType.SWAGGER_2)
//                .apiInfo(apiInfo())
//                .select()
//                .apis(RequestHandlerSelectors.basePackage("com.yxuan.springboot.controller"))//扫描的包路径
//                .build()
//                .globalOperationParameters(this.getParameterList());
//    }
//
//
//    private ApiInfo apiInfo() {
//        return new ApiInfoBuilder()
//                .title("志愿护航接口文档")
//                .version("1.0.0")
//                .contact(new Contact("朱超","",""))
//                .build();
//    }
//
//    /**
//     * 添加head参数配置
//     */
//    private List<Parameter> getParameterList() {
//        ParameterBuilder clientIdTicket = new ParameterBuilder();
//        List<Parameter> pars = new ArrayList<Parameter>();
//        clientIdTicket.name("token").description("token令牌")
//                .modelRef(new ModelRef("string"))
//                .parameterType("header")
//                .required(false).build(); //设置false，表示clientId参数 非必填,可传可不传！
//        pars.add(clientIdTicket.build());
//        return pars;
//    }
//}
